/* 
 *  Incub - incubate your baby robot
 *  Copyright (C) 2008 Stanislaw Szymczyk
 *  e-mail: sszymczy@gmail.com   www: http://cogville.cog-lab.com
 *
 *  This file is part of Incub.
 *
 *  Incub is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  Incub is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Incub.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
 
#include "TactileMatrix.h"

using std::string;

TactileMatrix::TactileMatrix() {
	this->shape = NULL;
	this->shapeIndex = 0;
	this->touchResolution = 0.05;	
}

std::vector<TactileSensor*>& TactileMatrix::getSensors() {
	return sensors;
};

void TactileMatrix::setShape(Shape *shape) {
	this->shape = shape;
}

Shape* TactileMatrix::getShape() {
	return shape;
}

void TactileMatrix::setShapeIndex(string shapeIndex) {
	this->shapeIndex = atoi(shapeIndex.c_str());
}

int TactileMatrix::getShapeIndex() {
	return this->shapeIndex;
}

void TactileMatrix::setTouchResolution(string res) {
	touchResolution = atof(res.c_str());
}

float TactileMatrix::getTouchResolution() {
	return touchResolution;
}

TactileMatrix::~TactileMatrix() {
	for(std::vector<TactileSensor*>::iterator it = sensors.begin(); it != sensors.end(); it++) {
		TactileSensor *sensor = *it;
		delete sensor;
	}
}

void TactileMatrix::addTactileSensor(TactileSensor *sensor) {
	sensors.push_back(sensor);
}
